package com.woniuxy04;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author 作者
 * @create 2025-06-05 16:23
 */
public class Test01 {
    public static void main(String[] args) throws ParseException {
        stringToDate("20a00-12-11");
        System.out.println("aaa");
    }

    //字符串转日期
    public static Date stringToDate(String str) throws ParseException {
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        Date date = df.parse(str);
        return date;
    }
}
